
var Product = (function () {
    function _product(name, price, quantity) {
        if (Object.getPrototypeOf(this) !== Product.prototype) {
            throw new TypeError("This browser does not support Object.getPrototypeOf, please use a polyfill to add this functionality.");
        }
        this.name = name;
        this.price = price;
        this.quantity = quantity;
    };

    Product.count = 0;

    Object.defineProperty(this, "getTotal", {
        get() {
            return this.price * this.quantity;
        },
        enumerable: false
    });

    Object.defineProperty(this, "increase", {
        enumerable: false,
        value: function () {
            if (Object.getPrototypeOf(this) === Product.prototype.increase.prototype) {
                throw new Error("increase is not a constuctor!");
            };
            this.quantity++;
        }
    })

    return _product;
})();
